﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="dictcollege.aspx.cs" Inherits="Basic_dictcollege" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>学院字典</title>
    <link rel="stylesheet" type="text/css" href="../js/themes/default/easyui.css"/>
	<link rel="stylesheet" type="text/css" href="../js/themes/icon.css"/>
	<link rel="stylesheet" type="text/css" href="../CSS/Style.css"/>
    <script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script>
   	<script type="text/javascript" src="../js/jquery.easyui.min.js"></script> 
    <script type="text/javascript">
      function addcollege(){
      $("#addcoll").toggle();
     }  
     function cancel(){
     $("#addcoll").css("display","none");
     }
     function check(){
     var str=$.trim($("#txtAdd").val()); 
     if(str==""){
          $("#note").text("院系名字不能为空！");
          $("#note").css("color","red");
           return false;
         }
     else{
         addcollege(); 
         return true; 
        } 
     }
   </script> 
</head>
<body>
    <form id="form1" runat="server">
   	<div style="background:#efefef;">
         <a href="javascript:addcollege()" class="easyui-linkbutton" plain="true" icon="icon-add">增加院系</a>
	</div>	
	        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate>
           <div id="addcoll" style="background:#efefef; display:none;"><span>请输入院系名称：</span>
	<asp:TextBox ID="txtAdd" runat="server"></asp:TextBox><asp:Button ID="btnSubmit" runat="server" Text="提交"
	 OnClientClick="return check();" OnClick="btnSubmit_Click" CssClass="btn-dy-blue" />
               <input id="Button1" type="button" value="放弃" onclick="cancel()" class="btn-dy-blue" /><span id="note"></span></div>  
            </ContentTemplate>
        </asp:UpdatePanel>
 <div style="background: #FFFCC9;border: 1px solid #FFD667;"><img id="warning"  src="../Images/Warning.png" alt="提示" />
    <span>提示：若您想删除一个院系，请先确保其下无任何教师注册，否则无法删除。删除之后有关学院数量控制的数据也一并删除。</span> </div> 
  <div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:GridView ID="GridView1" runat="server" CssClass="gvStyle" AlternatingRowStyle-CssClass="alt" 
                PagerStyle-CssClass="pgr" OnRowCommand="GridView1_RowCommand" AutoGenerateColumns="False" 
                Width="100%" Font-Bold="False" EmptyDataText="暂时没有任何院系数据！" OnRowCancelingEdit="GridView1_RowCancelingEdit" 
                EnableTheming="False" OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating" 
                DataKeyNames="collegeid">
                    <Columns>
                        <asp:TemplateField HeaderText="序号">
                            <ItemTemplate> 
                                 <%# (this.AspNetPager1.CurrentPageIndex - 1) * this.AspNetPager1.PageSize + Container.DataItemIndex + 1%>
                            </ItemTemplate> 
                            <ItemStyle Width="30px" />
                                </asp:TemplateField>
                        <asp:BoundField DataField="collegename" HeaderText="院系名称" />
                        <asp:BoundField DataField="incharge" HeaderText="管理员" ReadOnly="True" >
                            <ItemStyle Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="regisdate" HeaderText="建设日期" ReadOnly="True" >
                            <ItemStyle Width="180px" />
                        </asp:BoundField>
                        <asp:CommandField ShowEditButton="True" ButtonType="Image" CancelImageUrl="~/js/themes/icons/undo.png" EditImageUrl="~/js/themes/icons/pencil.png" UpdateImageUrl="~/js/themes/icons/filesave.png" HeaderText="操作" >
                            <ItemStyle Width="60px" />
                        </asp:CommandField>
                        <asp:TemplateField HeaderText="删除">
                            <ItemTemplate>
                                <asp:ImageButton ID="ImageButton1" runat="server" CommandName="delcollege" ImageUrl="~/js/themes/icons/cancel.png" CommandArgument="<%# Container.DataItemIndex %>" OnClientClick='return confirm("您确定要删除此院系？");' />&nbsp;
                            </ItemTemplate>
                            <ItemStyle Width="30px" />
                        </asp:TemplateField>
                    </Columns>
                         <PagerStyle CssClass="pgr" />
                     <AlternatingRowStyle CssClass="alt" />
                </asp:GridView>
                <webdiyer:aspnetpager id="AspNetPager1" runat="server"
                        HorizontalAlign="Right" LastPageText="末页" NextPageText="下一页" 
                        PageIndexBoxType="TextBox" PageSize="15" PrevPageText="上一页" ShowCustomInfoSection="Left"
                        ShowPageIndexBox="Always" Width="100%" CustomInfoHTML="共<font color=blue><b>%RecordCount%</b></font>条数据 每页：<font color=blue><b>%PageSize%</b></font> 条 共<font color=blue><b>%PageCount%</b></font>页 当前页：<font color=red><b>%CurrentPageIndex%/%PageCount%</b></font>" OnPageChanged="AspNetPager1_PageChanged" CustomInfoSectionWidth="50%" FirstPageText="首页" AlwaysShow="True" CustomInfoTextAlign="Left">
                </webdiyer:aspnetpager>
            </ContentTemplate>
        </asp:UpdatePanel></div> 
    </form>
</body>
</html>
